package top.sqdpt.web.handler;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import top.sqdpt.web.entity.Result;

import java.io.IOException;

@RestControllerAdvice
public class VxAiChatHandler {

    @ExceptionHandler(RuntimeException.class)
    public Result<Void> handException(RuntimeException e) {
        return Result.error(e.getMessage());
    }

    @ExceptionHandler(IOException.class)
    public Result<Void> handException(IOException e) {
        return Result.error("文件传输出现错误");
    }

    @ExceptionHandler(Exception.class)
    public Result<Void> handException(Exception e) {
        return Result.error("系统错误");
    }

}
